﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BaseData
{
    /// <summary>
    /// 业务类型
    /// </summary>
    public enum BusinessType
    {
        ShiZirRead, ShiZirWrite
    }

    /// <summary>
    /// 用户类型
    /// </summary>
    public enum UserType
    {
        /// <summary>
        /// 经纪人
        /// </summary>
        Agent = 0,
        /// <summary>
        /// 门店主管
        /// </summary>
        StoreManager = 1,
        /// <summary>
        /// 门店主管
        /// </summary>
        CompanyManager = 2,
        /// <summary>
        /// 门店主管
        /// </summary>
        SuperManager = 100
    }

    public class Base
    {
        /// <summary>
        /// 根据业务类型返回数据库连接字符串名称
        /// </summary>
        /// <param name="businessType">业务类型</param>
        /// <returns>数据库连接字符串名称</returns>
        protected static string GetConnectionStr(BusinessType businessType)
        {
            string connstr = string.Empty;
            switch (businessType)
            {
                case BusinessType.ShiZirRead:
                    connstr = "ShiZirRead";
                    break;
                case BusinessType.ShiZirWrite:
                    connstr = "ShiZirWrite";
                    break;
                default:
                    break;
            }

            return connstr;
        }
    }
}
